package 笔试;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class 滴滴_桃子装箱 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int k = scan.nextInt();
        scan.nextLine();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = scan.nextInt();
        }
        Arrays.sort(a);
        boolean flag = false;
        ArrayList<Integer> list = new ArrayList<>();
        int count = 0;
        for (int i = 0; i < n; i++) {
            list.add(a[i]);
            count += a[i];
        }
        while(!flag) {
            int tmp = count / list.size();
            if(list.get(list.size()-1) > tmp*k) {
                count -= list.get(list.size()-1);
                list.remove(list.size()-1);
            } else {
                flag = true;
            }
        }
        System.out.println(list.size());
    }
}
